﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CodeGame.Networking.Clientside;

namespace CodeGame.LuaLibary
{
    internal static class luaLib_entity
    {

        [LuaHelp("Creates a new Entity")]
        public static void create(string name)
        {
            ClientProtocolEntity.CreateEntity(name);
        }

        [LuaHelp("Spawns a created entity at a location, you can do this more then once")]
        public static void spawn(string name, int x, int y)
        {
            ClientProtocolEntity.SpawnEntity(name, x, y);
        }

        [LuaHelp("Moves a entity in a pre specifyed direction")]
        public static void move(string name, int amount)
        {
            ClientProtocolEntity.MoveEntity(name, amount);
        }

        [LuaHelp("Turns a entity by a angle in degrees")]
        public static void turn(string name)
        {
            ClientProtocolEntity.TurnEntity(name);
        }

        [LuaHelp("Sets a tint for a Entity to a certain colour")]
        public static void tint(string name, int r, int g, int b)
        {
            ClientProtocolEntity.TintEntity(name, r, g, b);
        }

        [LuaHelp("Textures a Entity to a Skin")]
        public static void texture(string name, string texture)
        {
            ClientProtocolEntity.TextureEntity(name, texture);
        }

        [LuaHelp("Returns the Private IDS for all entity in a radius")]
        public static void pulse(string id)
        {
            ClientProtocolEntity.Pulse(id);
        }

        [LuaHelp("Returns all Public ID's")]
        public static void getAll()
        {
            Singletons.Console.Print("All Entity's: \n" + Singletons.CurrentWorld.ReturnAllID(), Singletons.NormalText);
        }

        [LuaHelp("Makes you the owner for a target entity")]
        public static void owner(string id)
        {
            ClientProtocolEntity.MakeOwner(id);
        }

    }
}
